<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ taglib uri="/WEB-INF/tlds/att.tld" prefix="att"%>
<html>
<head>
<title>打印页</title>
<meta charset="utf-8"></meta>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="static/lib/jquery/1.9.1/jquery-1.9.1.min.js"
	type="text/javascript"></script>
<link href="static/lib/bootstrap/3.0.2/css/bootstrap.min.css"
	type="text/css" rel="stylesheet" />
<link href="static/lib/bootstrap/3.0.2/css/bootstrap-theme.css"
	type="text/css" rel="stylesheet" />
<script src="static/lib/bootstrap/3.0.2/js/bootstrap.min.js"
	type="text/javascript"></script>
<link href="static/css/layout.css" type="text/css" rel="stylesheet" />
<script type="text/javascript">
	$(document).ready(function() {
		var http_request = false;
		function createXmlRequest() {
			if (window.ActiveXObject) { // IE浏览器
				try {
					http_request = new ActiveXObject("Msxml2.XMLHTTP");
				} catch (e) {
					try {
						http_request = new ActiveXObject("Microsoft.XMLHTTP");
					} catch (e) {
					}
				}
			} else {
				if (window.XMLHttpRequest) { //Mozilla 浏览器
					http_request = new XMLHttpRequest();
					if (http_request.overrideMimeType) {//设置MiME类别
						http_request.overrideMimeType("text/xml");
					}
				}
			}
		}

	});

	function doPrint() {
		bdhtml = window.document.body.innerHTML;
		sprnstr = "<!--startprint-->";
		eprnstr = "<!--endprint-->";
		prnhtml = bdhtml.substr(bdhtml.indexOf(sprnstr) + 17);
		prnhtml = prnhtml.substring(0, prnhtml.indexOf(eprnstr));
		window.document.body.innerHTML = prnhtml;
		window.print();
		setTimeout('window.close()', 5000);
	}
</script>
</head>
<body>
	<!--startprint-->
	<div style="background: #FFF; width: 100%">
		<div>
			<h3 class="center">供应商发票信息</h3>
			<table class="table o-l-table table-bordered" id="table1"
				style="font-size: 13.5px">
				<tbody>
					<tr>
						<td class="text-left" style="width: 20%">供应商编号:</td>
						<td style="width: 30%">${statementInvoice.supplierNo}</td>
						<td class="text-left" style="width: 20%">供应商名称:</td>
						<td style="width: 30%">${statementInvoice.supplierName}</td>
					</tr>
					<tr>
						<td class="text-left" style="width: 20%">供应商合同号:</td>
						<td style="width: 30%">${statementInvoice.contractNumber}</td>
						<td class="text-left" style="width: 20%">结算单号:</td>
						<td style="width: 30%">${statementInvoice.billNo}</td>
					</tr>
					<tr>
						<td class="text-left" style="width: 20%">结算开始日期:</td>
						<td style="width: 30%">
								<fmt:formatDate value="${statementInvoice.startDate}"
													pattern="yyyy-MM-dd" /></td>

						<td class="text-left" style="width: 20%">结算结束日期:</td>
						<td style="width: 30%"><fmt:formatDate
								value="${statementInvoice.endDate}" pattern="yyyy-MM-dd" /></td>
					</tr>
					<tr>
						<td class="text-left" style="width: 20%">区域:</td>
						<td style="width: 30%"><ossp:select name="regionCode"
								value="${statementInvoice.regionCode}"
								service="selectOneRegionService"
								htmlEleProperties="disabled=\"disabled\""></ossp:select></td>

						<td class="text-left" style="width: 20%">分店:</td>
						<td style="width: 30%"><ossp:select name="shopCode"
								value="${statementInvoice.shopCode}"
								service="selectOneShopService"
								htmlEleProperties="disabled=\"disabled\""></ossp:select></td>
					</tr>
					<tr>
						<td class="text-left" style="width: 20%">应开票金额:</td>
						<td style="width: 30%">${statementInvoice.billingAmount}</td>

						<td class="text-left" style="width: 20%">未含税金额:</td>
						<td style="width: 30%">${statementInvoice.billedAmount}</td>
					</tr>
					<tr>
						<td class="text-left" style="width: 20%">税额:</td>
						<td style="width: 30%">${statementInvoice.taxAmount}</td>

						<td class="text-left" style="width: 20%">已开票金额:</td>
						<td style="width: 30%">${statementInvoice.totalAmount}</td>
					</tr>
					<tr>
						<td class="text-left" style="width: 20%">未开票金额:</td>
						<td style="width: 30%">${statementInvoice.unbilledAmount}</td>

						<td class="text-left" style="width: 20%">楼层:</td>
						<td style="width: 30%">${statementInvoice.floorName}</td>
					</tr>
					<tr>
						<td class="text-left" style="width: 20%">审批状态:</td>
						<td style="width: 30%"><ossp:value dictType="approvalStatus"
								key="${statementInvoice.status}"></ossp:value></td>

						<td class="text-left" style="width: 20%">审批人:</td>
						<td style="width: 30%">${statementInvoice.approverName}</td>
					</tr>
				</tbody>
			</table>
		</div>
		<div>
			<h4>发票明细</h4>
			<table
				class="table table-striped table-hover o-l-table table-bordered"
				id="table2" style="font-size: 13.5px; text-align: center">
				<thead>
					<tr>
						<th style="width: 50px">发票号码</th>
						<th style="width: 80px">税率</th>
						<th style="width: 30%">价税合计金额</th>
						<th style="width: 12%">税额</th>
						<th style="width: 15%">联系电话</th>
						<th>备注</th>
					</tr>
				</thead>
				<tbody>
					<c:forEach items="${statementInvoice.invoiceDetailList}"
						var="itemCode" varStatus="var">
						<tr>
							<td>${itemCode.invoiceCode}</td>
							<td>${itemCode.taxRate}%</td>
							<td>${itemCode.totalAmount}</td>
							<td>${itemCode.taxAmount}</td>
							<td>${itemCode.contactNumber}</td>
							<td>${itemCode.remark}</td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
		</div>
	</div>
	<!--endprint-->
	<div style="width: 75%" align="center">
		<button class="btn btn-default btn_5" onClick="doPrint();">
			打印</button>
		<button class="btn btn-default btn_5" onClick="window.close();">
			关闭</button>
	</div>
</body>
</html>